package rmi;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;

import controller.MesaController;
import interfaz.InterfazRestaurante;

import beans.ItemComandaBean;
import beans.MedioPagoBean;
import beans.MesaBean;
import beans.MozoBean;
import beans.PlatoBean;
import beans.RestauranteBean;

public class RestauranteRMI extends UnicastRemoteObject implements InterfazRestaurante {
	private static final long serialVersionUID = 1L;
	
	public RestauranteRMI() throws RemoteException {
//		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	public List<MesaBean> getMesasPorEstado(String estado)  throws RemoteException{
		MesaController controller = new MesaController();
		return controller.getMesasPorEstado(estado);
	}

	@Override
	public void liberarMesa(Integer restaurante, Integer mesa)  throws RemoteException{
		MesaController controller = new MesaController();
		controller.liberarMesa(restaurante, mesa);
	}

	@Override
	public List<MesaBean> getMesasDeMozo(Integer legajo) throws RemoteException {
		MesaController controller = new MesaController();
		return controller.getMesasDeMozo(legajo);
	}

	@Override
	public List<MozoBean> getMozosDeRestaurante(Integer restaurante) throws RemoteException {
		MesaController controller=new MesaController();
		return controller.getMozosDeRestaurante(restaurante);
	}

	@Override
	public List<RestauranteBean> getRestaurantes() throws RemoteException {
		MesaController controller=new MesaController();
		return controller.getRestaurantes();
	}

	@Override
	public void generarComandas(Integer numeroMesa,
			List<ItemComandaBean> itemsComanda) throws RemoteException {
		MesaController c  = new MesaController();
		c.generarComandas(numeroMesa, itemsComanda);
	}

	@Override
	public void registrarAperturaMesa(Integer legajo, Integer numeroMesa,
			Integer cantComensales) throws RemoteException {
		MesaController controller=new MesaController();
		controller.registrarAperturaMesa(legajo, numeroMesa, cantComensales);
	}


	@Override
	public void generarFactura(Integer mesa, Integer medioPago)
			throws RemoteException {
		// TODO Auto-generated method stub
		MesaController controller=new MesaController();
		controller.generarFactura(mesa, medioPago);
	}

	@Override
	public void cerrarMesa(Integer restaurante, Integer mesa) throws RemoteException {
		// TODO Auto-generated method stub
		MesaController controller = new MesaController();
		controller.cerrarMesa(restaurante, mesa);
		
	}


	@Override
	public List<MedioPagoBean> getMediosPago() throws RemoteException {
		MesaController controller=new MesaController();
		return controller.getMediosPago();
	}

	@Override
	public Float calcularTotalMesa(Integer restaurante, Integer mesa)
			throws RemoteException {
		// TODO Auto-generated method stub
		MesaController controller=new MesaController();
		return controller.calcularTotalMesa(restaurante, mesa);
	}

}
